package com.qijian.business.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 生产工单对象 kr_work_order
 *
 * @author qijian
 * @date 2024-02-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("kr_work_order")
public class KrWorkOrder extends BaseEntity{
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "唯一id")
    private Long id;

    @Excel(name = "来源订单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "来源订单id")
    private Long sourceId;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开工日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开工日期")
    private Date startDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完工日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "完工日期")
    private Date endDate;

    @Excel(name = "状态")
    @ApiModelProperty(value = "状态")
    private Boolean status;

    @Excel(name = "尺寸公差")
    @ApiModelProperty(value = "尺寸公差")
    private String sizeTolerance;

    @Excel(name = "TS/EL(N/MM2)")
    @ApiModelProperty(value = "TS/EL(N/MM2)")
    private String tsEl;

    @Excel(name = "重量公差")
    @ApiModelProperty(value = "重量公差")
    private String weightTolerance;

    @Excel(name = "包装方式")
    @ApiModelProperty(value = "包装方式")
    private String packageMode;

    @Excel(name = "收线方向")
    @ApiModelProperty(value = "收线方向")
    private String pickupDirection;

    @Excel(name = "内径")
    @ApiModelProperty(value = "内径")
    private String boreSize;

    @Excel(name = "表面")
    @ApiModelProperty(value = "表面")
    private String surface;

    @Excel(name = "工单号")
    @ApiModelProperty(value = "工单号")
    private String orderNo;

    @Excel(name = "投料编码")
    @ApiModelProperty(value = "投料编码")
    private String feedNo;

    @Excel(name = "流转卡号")
    @ApiModelProperty(value = "流转卡号")
    private String circulationNo;

    @Excel(name = "流转卡是否生成")
    @ApiModelProperty(value = "流转卡是否生成")
    private String circulationStatus;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "流转卡生成时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "流转卡生成时间")
    private Date circulationDate;

    @Excel(name = "是否包含子工单")
    @ApiModelProperty(value = "是否包含子工单")
    private Boolean isContain;

    @Excel(name = "投料状态")
    @ApiModelProperty(value = "投料状态")
    private String feedStatus;

    @Excel(name = "投料人")
    @ApiModelProperty(value = "投料人")
    private String feedBy;

    @Excel(name = "客户名称")
    @ApiModelProperty(value = "客户名称")
    private String customerName;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交货日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "交货日期")
    private Date deliveryDate;

    @Excel(name = "部门名称")
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @Excel(name = "订单号")
    @ApiModelProperty(value = "订单号")
    private String number;

    @Excel(name = "制单人")
    @ApiModelProperty(value = "制单人")
    private String preparedBy;

    @Excel(name = "工单生产量")
    @ApiModelProperty(value = "工单生产量")
    private BigDecimal qty;

    @Excel(name = "工单需求量")
    @ApiModelProperty(value = "工单需求量")
    private BigDecimal needQty;

    @Excel(name = "页面展示工单需求量")
    @ApiModelProperty(value = "页面展示工单需求量")
    private BigDecimal showNeedQty;

    @Excel(name = "库存数量")
    @ApiModelProperty(value = "库存数量")
    private BigDecimal sdQty;

    @Excel(name = "删除用库存")
    @ApiModelProperty(value = "删除用库存")
    private BigDecimal deleteQty;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "工单日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "工单日期")
    private Date orderTime;

    @Excel(name = "路线id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "路线id")
    private Long lineId;

    @Excel(name = "来源工单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "来源工单id")
    private Long parentId;

    @Excel(name = "物料id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "物料id")
    private Long itemId;

    @Excel(name = "物料代码")
    @ApiModelProperty(value = "物料代码")
    private String itemCode;

    @Excel(name = "物料名称")
    @ApiModelProperty(value = "物料名称")
    private String itemName;

    @Excel(name = "物料规格")
    @ApiModelProperty(value = "物料规格")
    private String itemSpec;

    @Excel(name = "是否已生成对应工单工序")
    @ApiModelProperty(value = "是否已生成对应工单工序")
    private Boolean isProcess;

    @Excel(name = "质检状态")
    @ApiModelProperty(value = "质检状态")
    private Boolean examineStatus;

    @Excel(name = "是否已经派工")
    @ApiModelProperty(value = "是否已经派工")
    private Boolean isDispatch;

    @Excel(name = "bom的id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "bom的id")
    private Long bomId;

    @Excel(name = "bom的detailId")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "bom的detailId")
    private Long bomDetailId;

    @Excel(name = "当工单号包含SOD时给U8的工单号")
    @ApiModelProperty(value = "当工单号包含SOD时给U8的工单号")
    private String toU8OrderNo;

    @Excel(name = "订单类型")
    @ApiModelProperty(value = "订单类型")
    private String orderType;

    @Excel(name = "唯一验证")
    @ApiModelProperty(value = "唯一验证")
    private String uniqueVerify;

    @ApiModelProperty(value = "是否报废")
    @TableField(exist = false)
    private Boolean scrapStatus;

    @ApiModelProperty(value = "质检状态")
    @TableField(exist = false)
    private Boolean isStop;

    @ApiModelProperty(value = "是否退料")
    @TableField(exist = false)
    private Boolean isBack;

    private String kingdeeId;

    @TableField(exist = false)
    private String endItemCode;

    @Excel(name = "组织名称")
    @ApiModelProperty(value = "组织名称")
    private String organizationName;


    private String kingdeeCode;

}
